# -*- coding: utf-8 -*-
from neo4j import *


def solve_room_card_a(entity):
    room = entity['room'][0]
    res = get_property(room)
    ans = "\n"
    if res['card'] != '':
        ans += "进" + room + "需要满足的条件为：\n"
        if res['card'].find(u"，") != -1:
            card_arr = res['card'].split("，")
            for card in card_arr:
                card_res = get_property(card)
                ans += "年龄" + card_res['age'] + "的读者可以持" + card_res[
                    'office_name'] + "进入" + room + "\n"
        else:
            card_res = get_property(res['card'])
            ans += "年龄" + card_res['age'] + "的读者可以持" + card_res[
                'office_name'] + "进入" + room + "\n"
    else:
        ans += "进入该馆室无需证件\n"
    return ans
